package org.fatewa.engine.exception;

import org.fatewa.engine.advice.protocol.RayquazaResponse;
import org.fatewa.engine.design.advice.AbstractExceptionProcessor;
import org.springframework.http.HttpStatus;
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;

/**
 * 方法参数不匹配类型的处理器
 *
 * @author fatewa
 */
public class MethodArgumentTypeMismatchProcessor
        extends AbstractExceptionProcessor<MethodArgumentTypeMismatchException> {

    @Override
    public RayquazaResponse map(MethodArgumentTypeMismatchException e) {
        return new RayquazaResponse()
                .msg("参数错误或请求路径不存在")
                .code(HttpStatus.BAD_REQUEST);
    }

}
